﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Presentation/master.Master" AutoEventWireup="true" CodeBehind="ApproveAdjVoucherUI.aspx.cs" Inherits="Staionery_Inventory.Presentation.StockCard.ApproveAdjVoucherUI__Reload_" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
            <%-- Title--%>
            <div class="form-group">
                
                <label class="col-sm-12" style="font-size:xx-large">Appove Adjustment Voucher</label>
            </div>

            <%-- AllVouchers--%>
            <div class="form-group">

                <asp:GridView ID="gvPendingVoucher" runat="server" AutoGenerateColumns="False" 
                    CssClass="col-sm-12 table table-striped table-bordered table-hover" 
                    onrowdeleting="gvPendingVoucher_RowDeleting" >
                    <Columns>
                        <asp:BoundField HeaderText="Item Code" DataField="ItemID" >
                        </asp:BoundField>
                        <asp:BoundField HeaderText="Quantity Adjusted" DataField="QtyAdj" />
                        <asp:BoundField HeaderText="Reason" DataField="Reason" />
                        <asp:BoundField HeaderText="Item Cost S$" DataField="Cost" />
                        <asp:TemplateField HeaderText="Select All">

                            <HeaderTemplate>
                                Select All&nbsp;
                                <asp:CheckBox ID="cbAllPendingVoucher" runat="server" 
                                    name="cbAllPendingVoucher" onclick="doSelect()" />
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:CheckBox ID="cbPendingVoucher" runat="server" name="cbPendingVoucher"/>
                            </ItemTemplate>

                        </asp:TemplateField>
                        <asp:CommandField ShowDeleteButton="True" />
                    </Columns>
                </asp:GridView>
            </div>

            <%-- button group --%>
            <div class="form-group">
                <div class="col-sm-4"></div>
                <div class="col-sm-5">
                    <asp:Button class="btn btn-primary btn-lg" ID="btnCreate" runat="server" 
                        Text="Approve" style="width:150px" onclick="btnCreate_Click" />
                </div>
                <div class="col-sm-2">
                </div>
                <div class="col-sm-5"></div>
            </div>
       
            <%-- message label --%>
            <div class="form-group">
                <div class="col-sm-2"></div>
                <asp:Label ID="lblMessage" runat="server" Text="" class="control-label col-sm-8" style="text-align:left"></asp:Label>
            </div>

            <%-- HiddenFieldCheck --%>
            <label ID="lblEmpName" style="visibility:hidden" runat="server"></label>

    <script language="javascript" type="text/javascript">
        function doSelect() {
            var dom = document.all;
            var el = event.srcElement;
            if (el.id.indexOf("cbAllPendingVoucher") >= 0 && el.tagName == "INPUT" && el.type.toLowerCase() == "checkbox") {
                var ischecked = false;
                if (el.checked)
                    ischecked = true;
                for (i = 0; i < dom.length; i++) {
                    if (dom[i].type == undefined) continue;
                    if (dom[i].id.indexOf("cbPendingVoucher") >= 0 && dom[i].tagName == "INPUT" && dom[i].type.toLowerCase() == "checkbox")
                        dom[i].checked = ischecked;
                }
            }
        }

    </script>   

</asp:Content>
